/*
 * @Date: 2023-03-30 11:50:30
 * @LastEditTime: 2023-04-10 16:22:33
 * @FilePath: /nlk/src/api/page/fundManage.ts
 * 介绍:
 */
import { defaHttp, ApiRes } from "../index";

/**赎回申购产品 */
export async function apiApplyBuyBack(
  data: ApplyBuyBack.Req
): Promise<void | true> {
  const res = await defaHttp.post<ApiRes<ApplyBuyBack.Res>>(
    "/storage/close",
    data,
    { mode: ["showError", "showLoading", "showSucceed"] }
  );
  if (res.code !== 200) return;
  return true;
}
/**赎回申购产品 */
export namespace ApplyBuyBack {
  export type Res = string;
  export interface Req {
    id: StrNumber;
  }
}
/**切换开启自动复投 */
export async function apiSwitchAutoSubmit(
  data: SwitchAutoSubmit.Req
): Promise<void | true> {
  const res = await defaHttp.post<ApiRes<SwitchAutoSubmit.Res>>(
    "/cancel/autostorage",
    data,
    { mode: ["showError"] }
  );
  if (res.code !== 200) return;
  return true;
}
/**切换开启自动复投 */
export namespace SwitchAutoSubmit {
  export type Res = string;
  export interface Req {
    user_store_id: StrNumber;
  }
}
